clear all; clc; close all

alpha_f = deg2rad(50);
beta_f = deg2rad(0);

alpha_s = deg2rad(-90:5:90); %угол места
beta_s = deg2rad(-180:5:180); %азимут

beta = H(alpha_f, beta_f);
F = nan(length(alpha_s), length(beta_s));
for a = 1:length(alpha_s)
    for b = 1:length(beta_s)
        S = 1;
        y = H(alpha_s(a),beta_s(b)) * S;
        U = beta' *y;
        F(a,b) = abs(U/S)^2;
    end
end
[alpha_sm,beta_sm] = meshgrid(alpha_s, beta_s);
[Fx, Fy, Fz]= sph2cart(beta_sm, alpha_sm, F.');
figure
surf(Fx, Fy, Fz);